
CC=gcc
CFLAGS=-Wall -ggdb -Werror -fPIC

LIBRARY_EXE = cedule

LIBRARY_OBJS= \
			  log.o \
			  frame.o \
			 #

LIBRARY_VERSION=1.0.1

#all: lib$(LIBRARY_EXE).so 
all: lib$(LIBRARY_EXE).a
	mkdir -p $(LIBRARY_EXE)
	cp -a *.h $(LIBRARY_EXE)/

lib$(LIBRARY_EXE).so: CFLAGS+=-fPIC
lib$(LIBRARY_EXE).so: $(LIBRARY_OBJS)
	# shared library
	gcc -shared -Wl,-soname,lib$(LIBRARY_EXE).so.1 -o lib$(LIBRARY_EXE).so.$(LIBRARY_VERSION) $(LIBRARY_OBJS)
	ln -sf lib$(LIBRARY_EXE).so.$(LIBRARY_VERSION) lib$(LIBRARY_EXE).so

lib$(LIBRARY_EXE).a: $(LIBRARY_OBJS)
	# static library
	ar rcs lib$(LIBRARY_EXE).a $(LIBRARY_OBJS)

clean:
	rm -f lib$(LIBRARY_EXE).a
	rm -f lib$(LIBRARY_EXE).so
	rm -f lib$(LIBRARY_EXE).so.1
	rm -f lib$(LIBRARY_EXE).so.$(LIBRARY_VERSION)
	rm -f $(LIBRARY_OBJS)
	rm -fr $(LIBRARY_EXE)/

